package org.xxx.epms.oss.service.Impl;

import com.qiniu.util.Auth;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.xxx.epms.oss.config.QiniuConfig;
import org.xxx.epms.oss.service.QiniuFileStorageService;

@Service
public class QiniuFileStorageServiceImpl implements QiniuFileStorageService {

    @Autowired
    private Auth auth;
    @Autowired
    private QiniuConfig qiniuConfig;

    @Override
    public String getUploadToken(String filekey) {
        return this.auth.uploadToken(qiniuConfig.getBucket(),filekey, qiniuConfig.getExpireSeconds(), null);
    }
}
